package dataImport.model;

import dataImport.model.abstracts.AbstractEntity;


public class RequirementTemp extends AbstractEntity {

	private static final long serialVersionUID = 8883794567355250184L;

	private String customActionId;

	private StaticRequirement staticRequirement;

	private String entityId;

	public RequirementTemp(final String customActionId, final StaticRequirement staticRequirement, final String entityId) {
		super(createId(customActionId, staticRequirement.getName(), entityId));
		this.customActionId = customActionId;
		this.staticRequirement = staticRequirement;
		this.entityId = entityId;
	}

	public String getCustomActionId() {
		return this.customActionId;
	}

	public void setCustomActionId(String customActionId) {
		this.customActionId = customActionId;
	}

	public StaticRequirement getStaticRequirement() {
		return this.staticRequirement;
	}

	public void setStaticRequirement(StaticRequirement staticRequirement) {
		this.staticRequirement = staticRequirement;
	}

	public String getEntityId() {
		return this.entityId;
	}

	public void setEntityId(String entityId) {
		this.entityId = entityId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((this.customActionId == null) ? 0 : this.customActionId.hashCode());
		result = prime * result + ((this.entityId == null) ? 0 : this.entityId.hashCode());
		result = prime * result + ((this.staticRequirement == null) ? 0 : this.staticRequirement.hashCode());
		return result;
	}

	@Override
	public boolean equals(java.lang.Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (this.getClass() != obj.getClass()) {
			return false;
		}
		RequirementTemp other = (RequirementTemp) obj;
		if (this.customActionId == null) {
			if (other.customActionId != null) {
				return false;
			}
		}
		else if (!this.customActionId.equals(other.customActionId)) {
			return false;
		}
		if (this.entityId == null) {
			if (other.entityId != null) {
				return false;
			}
		}
		else if (!this.entityId.equals(other.entityId)) {
			return false;
		}
		if (this.staticRequirement != other.staticRequirement) {
			return false;
		}
		return true;
	}

}
